import axios from 'axios'
import { defineStore } from 'pinia'
import { ref } from 'vue';

export const useChannelStore = defineStore("channel", () => {
    const channelList = ref([])
    const getList = async () => {
        const res = await axios.get("http://geek.itheima.net/v1_0/channels")
        console.log(res.data.data.channels,"bb");
        // console.log(res,"aaaa");
        channelList.value = res.data.data.channels
        // console.log(channelList.value);
    }
 
    return {
        channelList,
        getList
    }
},{
    persist:true
})
// export const store = useChannelStore(painia)